from urllib import parse

def url_encode(url):
    return parse.quote(string=url, encoding="utf-8")